package com.phuoc.activities;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageButton;
import android.widget.TextView;

public class CustomWindowForList extends ListActivity {
	
	protected ImageButton btnSearch;
	protected TextView txtTitle;
	protected ImageButton btnHome;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.activity_establishment);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customize_window);
		
		txtTitle = (TextView) findViewById(R.id.txtTitle);
		btnSearch = (ImageButton) findViewById(R.id.btnSearch);
		btnSearch.setOnClickListener(new OnClickListener() {
			
			public void onClick(View arg0) {
				onSearchRequested();
				
			}
		});
		
		btnHome = (ImageButton) findViewById(R.id.btnHome);
		btnHome.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent(CustomWindowForList.this, ListEstablishmentActivity.class);
				startActivity(intent);
			}
		});
	}
	
	protected void setWindowTitle(String name){
		txtTitle.setText(name);
	}
}
